package main;

import entities.Coupon;
import session.CouponManager;
import session.ICouponManager;

import java.math.BigDecimal;

/**
 * Created with IntelliJ IDEA.
 * User: alex
 * Date: 10/19/13
 * Time: 1:43 PM
 * To change this template use File | Settings | File Templates.
 */
public class RunHiber {

    public static void main(String [] args)
    {
        ICouponManager couponManager = new CouponManager();
        Coupon wanted = couponManager.findByCouponDeatils("test");

        Coupon cp1 = new Coupon(BigDecimal.valueOf(1),5, "alex", "test");
        Coupon cp2 = new Coupon(BigDecimal.valueOf(2),5, "alex", "test1");
        couponManager.saveNewCoupon(cp1);
        couponManager.saveNewCoupon(cp2);
        System.out.println("printing:");
        System.out.println("find by details: "+wanted);
        System.out.println("find by id: " + couponManager.findCouponById(BigDecimal.valueOf(1)));
        System.out.println("coupons list: "+couponManager.findAllCoupons());
        couponManager.deleteCoupon(BigDecimal.valueOf(1));
        couponManager.deleteCoupon(BigDecimal.valueOf(10));

    }
}
